package com.mikao.controller.order;

import com.mikao.dto.bo.OrderForm;
import com.mikao.dto.bo.SendForm;
import com.mikao.dto.vo.OrdersDto;
import com.mikao.dto.vo.RspDataTableDto;
import com.mikao.service.OrderService;
import org.springframework.context.annotation.Scope;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author kenny
 */

@RestController
@RequestMapping(value = "/management", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Scope("prototype")
public class OrderController {

    private OrderService orderService;

    public OrderController(OrderService orderService) {
        this.orderService = orderService;
    }

    @GetMapping("/orderList")
    public RspDataTableDto<OrdersDto> orderList(OrderForm orderForm) {
        return orderService.orderList(orderForm);
    }

    @PostMapping("/sendGoods")
    public void sendGoods(SendForm sendForm){
        orderService.sendGoods(sendForm);
    }
}
